/**
 * 
 */
package org.apache.struts.helloworld.action;

import org.apache.struts.helloworld.model.MessageStore;

import com.opensymphony.xwork2.ActionSupport;

/**
 *
 * @author wanghy
 * @since 2014-2-25
 * 
 */
public class HelloWorldAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private MessageStore messageStore;
	
	private static int helloCount = 0;
	
	private String userName;
	
	@Override
	public String execute() throws Exception {
		
		messageStore = new MessageStore();
		
		helloCount++;
		
		return SUCCESS;
	}

	/**
	 * @return the messageStore
	 */
	public MessageStore getMessageStore() {
		return messageStore;
	}

	/**
	 * @param messageStore the messageStore to set
	 */
	public void setMessageStore(MessageStore messageStore) {
		this.messageStore = messageStore;
	}

	/**
	 * @return the helloCount
	 */
	public int getHelloCount() {
		return helloCount;
	}

	/**
	 * @param helloCount the helloCount to set
	 */
	public void setHelloCount(int helloCount) {
		HelloWorldAction.helloCount = helloCount;
	}

	/**
	 * @return the userName
	 */
	public String getUserName() {
		return userName;
	}

	/**
	 * @param userName the userName to set
	 */
	public void setUserName(String userName) {
		this.userName = userName;
	}
	
}
